//3.
#include<stdio.h>
int main()
{
	int stand,p,money,num;
	printf("请输入站数:");
	scanf("%d",&stand);
	if(stand <= 6)
		p = 2;
	else if(stand <= 10)
		p = 3;
	else
		p = 4;
	do
	{
		printf("共%d元，请投币：",p);
		scanf("%d",&money);
		switch(money)
		{
		case 1:
			printf("面值不足，重新投币！\n");
			break;
		case 5:
			num = money - p;
			printf("找零%d张1元\n",num);
			break;
		case 10:
			num = money - p - 5;
			printf("找零1张5元和%d张1元\n",num);
			break;
		case 20:
			num = money - p - 15;
			printf("找零1张10元和1张5元和%d张1元\n",num);
			break;
		case 50:
			num = money - p -45;
			printf("找零2张20元和1张5元和%d张1元\n",num);
			break;
		case 100:
			num = money - p -95;
			printf("找零1张50元和2张20元和1张5元和%d张1元\n",num);
			break;
		default:
			printf("无效面值，重新投币！\n");
			break;
		}
	}while(num == 0);	
	return 0;
}
